package ALog;

public class Entry {
	private Date date;
	private double distance;
	private int durationInMinutes;
	private String postRunFeeling;

	public Entry(Date date, double distance, int durationInMinutes,
			String postRunFeeling) {
		this.date = date;
		this.distance = distance;
		this.durationInMinutes = durationInMinutes;
		this.postRunFeeling = postRunFeeling;
	}

	public String toString() {
		return this.date + " " + this.distance + " " + this.durationInMinutes
				+ " " + this.postRunFeeling;
	}

	public double getDistance() {
		return this.distance;

	}

	public boolean sameMonthInAYear(int month, int year) {
		return this.date.sameMonthInAYear(month, year);
	}

	public boolean equals(Object o) {
		if (o == null || !(o instanceof Entry))
			return false;
		else {
			Entry e = (Entry) o;
			return this.date.equals(e.date) && this.distance == e.distance
					&& this.durationInMinutes == e.durationInMinutes
					&& this.postRunFeeling.equals(e.postRunFeeling);
		}
	}
	public boolean hasDistanceShortThan(Entry e){
		return this.distance<e.distance;
	}
}
